package cn.trda.service.impl;

import java.util.List;

import cn.trda.mapper.HatAreaMapper;
import cn.trda.mapper.HatCityMapper;
import cn.trda.mapper.HatProvinceMapper;
import cn.trda.pojo.HatArea;
import cn.trda.pojo.HatCity;
import cn.trda.pojo.HatProvince;
import cn.trda.service.ProvinceService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ProvinceServiceImpl implements ProvinceService {
	
	@Autowired
	HatProvinceMapper provinceMapper;
	@Autowired
	HatCityMapper cityMapper;
	@Autowired
	HatAreaMapper areaMapper;
	@Override
	public List<HatProvince> getProvinceList() {
		// TODO Auto-generated method stub
		return provinceMapper.selectProvinceList();
	}

	@Override
	public List<HatCity> getCitys(HatProvince province) {
		// TODO Auto-generated method stub
		return cityMapper.selectCityList(province.getProvinceid());
	}

	@Override
	public List<HatArea> getAreas(HatCity city) {
		// TODO Auto-generated method stub
		return areaMapper.selectAreaList(city.getCityid());
	}

	@Override
	public List<HatCity> getCitysByProviceId(Long provinceId) {
		// TODO Auto-generated method stub
		return cityMapper.selectCityList(provinceId.toString());
	}

	@Override
	public List<HatArea> getAreaByCityId(Long cityId) {
		// TODO Auto-generated method stub
		return areaMapper.selectAreaList(cityId.toString());
	}
	
}
